import { createRouter, createWebHistory } from 'vue-router'
import LoginView from '@/views/LoginView.vue'

const routes = [
  {
    path: '/',
    name: 'login',
    component: LoginView,
    meta: { title: '登录' } 
  },
  {
    path: '/register',
    name: 'register',
    component: () => import('../views/RegisterView.vue'),
    meta: { title: '注册' } 
  },
  {
    path: '/dashboard',
    name: 'dashboard',
    component: () => import('@/layouts/DashboardLayout.vue'),
    meta: { title: "系统首页" }, 
    children: [
      {
        path: 'home',
        name: 'home',
        component: () => import('@/views/HomeView.vue'),
        meta: { title: "首页" } 
      },
      {
        path: 'info',
        name: 'info',
        component: () => import('@/views/InfoView.vue'),
        meta: { title: "个人信息" } 
      },
      {
        path: 'coach',
        name: 'coach',
        component: () => import('@/views/CoachView.vue'),
        meta: { title: "教练信息" } 
      },
      {
        path: 'car',
        name: 'car',
        component: () => import('@/views/CarView.vue'),
        meta: { title: "驾校车辆" } 
      },
      {
        path: 'training',
        name: 'training',
        component: () => import('@/views/TrainingView.vue'),
        meta: { title: "预约训练" } 
      },
      {
        path: 'record',
        name: 'record',
        component: () => import('@/views/RecordView.vue'),
        meta: { title: "训练记录" } 
      },
     
      {
        path: 'test_info',
        name: 'test_info',
        component: () => import('@/views/Test_info.vue'),
        meta: { title: "考试成绩" } 
      } ,
      {
        path: 'sing',
        name: 'sing',
        component: () => import('@/views/SingView.vue'),
        meta: { title: "签到/签退" } 
      },
      {
        path: 'test',
        name: 'test',
        component: () => import('@/views/Student_text.vue'),
        meta: { title: "预约记录" } 
      },
      {
        path: 'test_train',
        name: 'test_train',
        component: () => import('@/views/TestTrainView.vue'),
        meta: { title: "预约考试" } 
      }

    ]
  }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
